// LightSpeed2000
//
// Jan 17, 2010
package lightspeed;
import lightspeed.Media.Graphics.WindowManager;
import java.awt.*;
import javax.swing.*;

public class LightSpeed2000
{
	public static GraphicsDevice device;
	public static JFrame frame;
	
	public static int w = 1024, h = 768;	//default screen resolution
	
	public static void main(String[] args)
	{
		try
		{
			GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
			device = env.getDefaultScreenDevice();
			
			frame = new JFrame(device.getDefaultConfiguration());
			frame.setUndecorated(true);
            frame.setIgnoreRepaint(true);
            
            frame.setBackground(Color.black);
            
            frame.setContentPane(new WindowManager());
			
			//check if fullscreen is supported, otherwise run windowed
			if(device.isFullScreenSupported())
			{
				
				device.setFullScreenWindow(frame);
				if(device.isDisplayChangeSupported())
				{
					device.setDisplayMode(new DisplayMode(w, h, 32, 0));
				}
			}
			else
			{
				frame.setSize(w, h);
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				frame.setVisible(true);
			}
			//
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}
